
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    syUrl: {},
    
    xz: ""
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (event) {
    console.log(event);
    var x = event.xz;
    var time = event.type;
    
    var syUrl = app.globalData.Base +
      "?consName="+x+"&type="+time+"&key=49a2a6728430192ea83175cf626797ce";

    this.getListData(syUrl, "sy");
  

  },
  getListData: function (url) {
    var that = this;
    wx.request({
      url: url,
      method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
      header: {
        "Content-Type": "json"
      },
      success: function (res) {
        
        console.log(res)
        that.setData({
          xz: res.data,
          

        })
      },
      fail: function (error) {
        // fail
        //console.log("22")
      }
    })
  }
  , onShareAppMessage: function (res) {
    if (res.from === 'button') {
      // 来自页面内转发按钮
      console.log(res.target)
    }
    return {
      title: '',
      path: '/page/user?id=123',//某用户
      success: function (res) {
        wx.showToast({
          title: "转发成功",
          duration: 1000,
          icon: "success"
        })
      },
      fail: function (res) {

      }
    }
  }
})